var box8 = echarts.init(document.getElementById('box8'));
function resizeChart(){
    box8.resize()
}
window.addEventListener('resize',resizeChart)
$.get('./data/LanguageRanking.json').done(function(data) {
// 填入数据
    box8.setOption({
        title: {
            text: '编程语言排行',
            textStyle:{
                color:'rgb(84,112,198)'
              },
            left:'center',
            top:0
        },
        backgroundColor:'rgba(128,128,128,0.1)',
        tooltip: {
            show:'true',
            formatter:'{b}:{c}%'
        },
        series: [
            {
                name: '全球编程语言排行',
                type: 'wordCloud',
                // sizeRange:[15,100],
                size:['90%','90%'],
                textRotation:[0,45,90,135,-45,-90],
                textPadding:2.5,
                autoSize:{enable:true,minSize:4},
                textStyle:{
                        color:function(){
                            return 'rgb('+[
                                Math.round(Math.random()*255),
                                Math.round(Math.random()*255),
                                Math.round(Math.random()*255)
                            ].join(',')+')';
                    },
                    emphasis:{
                        shadowBlur:26,
                        color:'#333',
                        shadowColor:'#ccc',
                        fontSize:20
                    }
                },
                data:data
            }
        ]
    });
});
box8.on('click',function(params){
    window.open('https://www.baidu.com/s?wd='+encodeURIComponent(params.name));
})